#ifndef GANTTMODEL_H
#define GANTTMODEL_H

#include <QWidget>
#include <QDate>
#include <QAbstractTableModel>
#include <KDGanttView>
#include <KDGanttConstraintModel>
#include <KDGanttDateTimeGrid>
#include <KDGanttGlobal>
#include <KDGanttGraphicsView>
#include <KDGanttItemDelegate>
#include <KDGanttStyleOptionGanttItem>

#include <QDesktopServices>
#include <QSplitter>
#include <QTreeView>
#include <QHeaderView>
#include <QVBoxLayout>
#include "qpagebar.h"

namespace KDGantt {
class View;
}

class GanttTaskModel;

struct GanttTask
{
    QString taskTitle;
    QDate startDate;
    QDate endDate;
    QDate finishDate;
    QString taskStatus;
    QString realName;
    QString hours;
    QString fourthCol;
    QString fifthCol;
    QString taskId;

};

class GanttModel : public QWidget
{
    Q_OBJECT
public:
    explicit GanttModel(QWidget *parent = nullptr);

public:
    KDGantt::View *m_GntView;
    KDGantt::DateTimeGrid *m_dataGrid;
    GanttTaskModel *m_model;
    QPageBar *m_pageBar;
    QVBoxLayout *m_layoutGantt;


    void SetGanttModel();
    void SetModelFlag(int modelFlag);
    void BindModelData(const QList<GanttTask> &modelDdata);
    void SetStartEndData(QDate &startdate, QDate &endDate);
    void SetHorHeaderData(QStringList& horHeadData);
    void SetHeaderWidth(QVector<int>& headWidth);
    void SetDataModelType(int modelType);
    int  GetDataModelType();
signals:

private slots:
    void slotRowDoubleClicked(const QModelIndex index);
};

#endif // GANTTMODEL_H
